﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
//using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TLWinReplace
{
    public partial class SetupForm : Form
    {
        public string m_sTLWinDir;
        public string m_sJobCardDir;

        public SetupForm()
        {
            InitializeComponent();

            // initial
            m_sTLWinDir = "C:\\Dataio\\Tlwin";
            m_sJobCardDir = "T:\\FDRROOT";

            textBox1.Text = m_sTLWinDir;
            textBox2.Text = m_sJobCardDir;
        }

        public string TLWinDir
        {
            get { return m_sTLWinDir; }
            set { m_sTLWinDir = value; }
        }

        public string JobCardDir
        {
            get { return m_sJobCardDir; }
            set { m_sJobCardDir = value; }
        }

        // OK
        private void button1_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();            
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {
            m_sTLWinDir = textBox1.Text;
            //MessageBox.Show(m_sTLWinDir);
        }

        private void textBox2_TextChanged(object sender, EventArgs e)
        {
            m_sJobCardDir = textBox2.Text;
        }

        // Cancel
        private void button2_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }

        public void updatevalue(string str1, string str2)
        {
            m_sTLWinDir = str1;
            m_sJobCardDir = str2;

            textBox1.Text = str1;
            textBox2.Text = str2;
        }
    }
}
